package cn.bx.bid.ctrl;

import cn.bx.bid.entity.Userrole;
import cn.bx.bid.repository.RoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RoleController {

    @Autowired
    private RoleRepository roleRepository;
//    @Autowired
//    private DeptRepository deptRepository;

    @GetMapping(value = "findRoles", produces = "application/json;charset=utf-8")
    public List<Userrole> findRoles() {
        return roleRepository.findAll();
    }

}
